import 'package:flutter/material.dart';

void main() =>runApp(MyApp(
//    items:new List<String>.generate(10, (i)=>"item+$i")


));

class MyApp extends StatelessWidget {

  final List<String> items;

  MyApp({Key key, @required this.items}) :super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        title: "动态列表",
        home: Scaffold(
            appBar: AppBar(
              title: Text("动态列表"),
            ),
            body:My2()
        )
    );
  }

}
class My2 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return GridView(gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
      crossAxisCount: 4,
      mainAxisSpacing: 2.0,
      crossAxisSpacing: 2.0,
      childAspectRatio: 1.0,



    ),
      children: <Widget>[
        Image.network("https://gaitaobao4.alicdn.com/tfscom/i2/1120939063/O1CN012gx6c02Gou1JK565R_!!0-item_pic.jpg_300x300.jpg"),
        Image.network("https://gaitaobao4.alicdn.com/tfscom/i2/1120939063/O1CN012gx6c02Gou1JK565R_!!0-item_pic.jpg_300x300.jpg"),
        Image.network("https://gaitaobao4.alicdn.com/tfscom/i2/1120939063/O1CN012gx6c02Gou1JK565R_!!0-item_pic.jpg_300x300.jpg"),
        Image.network("https://gaitaobao4.alicdn.com/tfscom/i2/1120939063/O1CN012gx6c02Gou1JK565R_!!0-item_pic.jpg_300x300.jpg"),
        Image.network("https://gaitaobao4.alicdn.com/tfscom/i2/1120939063/O1CN012gx6c02Gou1JK565R_!!0-item_pic.jpg_300x300.jpg"),
        Image.network("https://gaitaobao4.alicdn.com/tfscom/i2/1120939063/O1CN012gx6c02Gou1JK565R_!!0-item_pic.jpg_300x300.jpg"),
        Image.network("https://gaitaobao4.alicdn.com/tfscom/i2/1120939063/O1CN012gx6c02Gou1JK565R_!!0-item_pic.jpg_300x300.jpg"),
        Image.network("https://gaitaobao4.alicdn.com/tfscom/i2/1120939063/O1CN012gx6c02Gou1JK565R_!!0-item_pic.jpg_300x300.jpg"),

      ],);
  }
}



class My extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return GridView.count(
      crossAxisSpacing: 10.0,
      crossAxisCount: 3,
      padding: EdgeInsets.all(20.0),
      children: <Widget>[
        Text("1"),
        Text("2"),
        Text("3"),
        Text("34r25tr"),
        Text("3rt2rt"),
        Text("33rt55t"),
      ],
    );
  }
}
